package com.icode.web.frontController.house;

import com.icode.core.dto.house.HouseBaseDTO;
import com.icode.service.house.HouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: xianfei
 * Date: 15-4-29
 * Time: 上午10:01
 * To change this template use File | Settings | File Templates.
 */
@Controller("apartmentFrontController")
@RequestMapping("/front/apartment")
public class ApartmentFrontController {

    @Autowired
    private HouseService houseService;

    @RequestMapping(value = "list", method = RequestMethod.GET)
    public String showList(Model model) {
        List<HouseBaseDTO> houseBaseDTOs = houseService.findAllApartment();
        model.addAttribute("houseBaseList", houseBaseDTOs);
        return "front/apartmentList";
    }


}
